package test07;
   import java.util.Scanner;


public class Six {
    public static void main (String[] args)

    {

        System.out.println("给你一个1至100之间的整数,请猜测这个数");


        int realNumber=(int)(Math.random()*100)+1;

        int yourGuess=0;
        Scanner sc=new Scanner(System.in);
        System.out.println("请输入你的猜想：");
        yourGuess=sc.nextInt();
        while(realNumber!=yourGuess) {

            if (yourGuess > realNumber) {

                System.out.println("你输入的数大了");

            } else if (yourGuess < realNumber) {
                System.out.println("你输入的数小了");

            }

        }

                    System.out.println("猜对了!");

                }


}

